package com.cynteka.cyfoman.core.config;

/**

 * User: Sergey
 * Date: 25.07.11
 * Time: 14:20
 */

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Items<T> implements Iterable<T> {

    private List<T> items = new ArrayList<T>();

    protected List<T> getItems() {
        return items;
    }

    protected void setItems(List<T> items) {
        this.items = items;
    }


    @Override
    public Iterator<T> iterator() {
        return items.iterator();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Items items1 = (Items) o;

        if (items != null ? !items.equals(items1.items) : items1.items != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return items != null ? items.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "Items{" +
                "items=" + items +
                '}';
    }
}
